CREATE TABLE [dbo].[Event]
(
[Oid] [uniqueidentifier] NOT NULL ROWGUIDCOL,
[ResourceIds] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[RecurrencePattern] [uniqueidentifier] NULL,
[Subject] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[StartOn] [datetime] NULL,
[EndOn] [datetime] NULL,
[AllDay] [bit] NULL,
[Location] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Label] [int] NULL,
[Status] [int] NULL,
[Type] [int] NULL,
[RecurrenceInfoXml] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OptimisticLockField] [int] NULL,
[GCRecord] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Event] ADD CONSTRAINT [PK_Event] PRIMARY KEY CLUSTERED  ([Oid]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iEndOn_Event] ON [dbo].[Event] ([EndOn]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iGCRecord_Event] ON [dbo].[Event] ([GCRecord]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iRecurrencePattern_Event] ON [dbo].[Event] ([RecurrencePattern]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iStartOn_Event] ON [dbo].[Event] ([StartOn]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Event] WITH NOCHECK ADD CONSTRAINT [FK_Event_RecurrencePattern] FOREIGN KEY ([RecurrencePattern]) REFERENCES [dbo].[Event] ([Oid]) NOT FOR REPLICATION
GO
